package com.spc.car.data.domain.attach.po;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.spc.car.data.annotation.Like;
import com.spc.car.data.annotation.Skip;
import com.spc.car.data.util.QueryUtil;
import lombok.Data;
import lombok.experimental.Accessors;

@Data
@Accessors(chain = true)
public class FilePO {

    private String fileOwner;

    private String fileCode;

    private Long deptId;

    @Skip
    private String projectCode;

    private String orgCode;
    private Integer personId;

    @Like
    private String fileName;

    private String catalog;

    private String ranges;

    @Skip
    private Integer page = 0;
    @Skip
    private Integer pageSize = 10;

    public Wrapper toWrapper() {
        QueryWrapper wrapper = QueryUtil.toWrapper(this);
        wrapper.eq("status", "A");
        wrapper.orderByDesc("create_time");

        return wrapper;
    }
}
